package com.zw.gulimall.cart.config;


import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Description: Url资源限流请求自定义返回
 **/
@Component
public class UrlBlockSentinelHandler {

    /**
     * 自定义限流返回信息
     *
     * @param request
     * @param response
     * @param ex
     * @throws IOException
     */
//    @Override
//    public void handle(HttpServletRequest request, HttpServletResponse response, BlockException ex) throws IOException {
//        R error = R.error(BizCodeEnume.TO_MANY_REQUEST.getCode(), BizCodeEnume.TO_MANY_REQUEST.getMsg());
//        response.setCharacterEncoding("UTF-8");
//        response.setContentType("application/json");
//        response.getWriter().write(JSON.toJSONString(error));
//    }
}
